<!DOCTYPE html>
<html>
  <head>
    <title>jQuery WeUI</title>
    <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">

<link rel="stylesheet" href="../dist/lib/weui.min.css">
<link rel="stylesheet" href="../dist/css/jquery-weui.css">
<link rel="stylesheet" href="css/login.css">

  </head>
 
  <body ontouchstart>
   <div class="main">
   	<div class="login-image">
   		<img alt="" src="images/ea7d4219d6b5f200a47c0afc0e9e9e89.jpg" width="100%" height="100%">
   	</div>
   	<div class="login-form">
	   	<form>
	   		<input class="weui-input" type="text" placeholder="请输入账号" id="code" value="201381020119">
	   		<input class="weui-input" type="password" placeholder="请输入密码" id="password" value="888888">
	   	</form>
	</div>
		<br>
 		<button href="javascript:;" id="login" class="weui-btn weui-btn_mini weui-btn_primary">登陆</button>
 	</div>
     <br>
    <div class="weui-footer_fixed-bottom">
		<div class="weui-footer ">
		  <p class="weui-footer__links">
		    <a href="javascript:void(0);" class="weui-footer__link">底部链接</a>
		    <a href="javascript:void(0);" class="weui-footer__link">底部链接</a>
		  </p>
		  <p class="weui-footer__text">Copyright © 2008-2016 weui.io</p>
		</div>
	</div>
    <script src="../dist/lib/jquery-2.1.4.js"></script>
	<script src="../dist/lib/fastclick.js"></script>
	<script>
	  $(function() {
	    FastClick.attach(document.body);
	  });
	</script>
<script src="../dist/js/jquery-weui.js"></script>
   <script>
   	$("#login").click(function(){
   		var code=$("#code").val();
   		var password=$("#password").val();
   		$.ajax({
   		   type: "POST",
   		   url: "/XYL/alumnus/login",
   		   data:{"code":code,"password":password},
   		   cache : false,  //禁用缓存
   		   dataType: "json",
   		   success: function(data) {
   			   if(data!=null){
   				  window.location.href="/XYL/mobile/page/index.html";
   			   }else{
   				 $.alert("密码或用户名错误，请重新输入！", "警告！");
   			   }
   			  
   		   },
   		   error: function(result){
   			 $.alert("密码或用户名错误，请重新输入！", "警告！");
   		   }
   		});
   	});
	</script>
  </body>
</html>
